const express = require("express");

const app = express();

app.get("/home", (req, res) => {
  res.end("hello home");
});

app.get("/", (req, res) => {
  res.end("hello express");
});

app.post("/login", (req, res) => {
  res.end("login");
});

//get或者post都满足
app.all("/test", (req, res) => {
  res.end("test");
});

app.all("*", (req, res) => {
  res.end("404");
});

app.listen(3001, () => {
  console.log("服务已经启动,监听3001");
});
